package com.d3works.apps.account.service.move;

import com.d3works.apps.account.db.Move;
import com.d3works.apps.base.db.Partner;
import com.d3works.db.Query;
import com.d3works.exception.D3worksException;
import java.util.List;

public interface MoveValidateService {

  /**
   * In move lines, fill the dates field and the partner if they are missing, and fill the counter.
   *
   * @param move
   */
  void completeMoveLines(Move move);

  void checkPreconditions(Move move) throws D3worksException;

  public void accounting(Move move) throws D3worksException;

  public void accounting(Move move, boolean updateCustomerAccount) throws D3worksException;

  /**
   * This method may generate fixed asset for each moveLine of move. It will generate if
   * moveLine.fixedAssetCategory != null AND moveLine.account.accountType.technicalTypeSelect =
   * 'immobilisation'
   *
   * @param move
   * @throws D3worksException
   * @throws NullPointerException if move is null or if a line does not have an account
   */
  void generateFixedAssetMoveLine(Move move) throws D3worksException;

  void validateWellBalancedMove(Move move) throws D3worksException;

  void updateValidateStatus(Move move, boolean daybook) throws D3worksException;

  void updateInDayBookMode(Move move) throws D3worksException;

  /**
   * Get the distinct partners of an account move that impact the partner balances
   *
   * @param move
   * @return A list of partner
   */
  List<Partner> getPartnerOfMoveBeforeUpdate(Move move);

  String accountingMultiple(List<Integer> moveIds);

  void freezeAccountAndPartnerFieldsOnMoveLines(Move move);

  void accountingMultiple(Query<Move> moveListQuery) throws D3worksException;

  void checkMoveLinesPartner(Move move) throws D3worksException;
}
